window.addEventListener('DOMContentLoaded', () => {
  // ipcRenderer.on('pageMessage', (event,data)=>{
  //   console.log(data)
  // })
})
    
//向渲染器进程暴露一个全局的 window.electronAPI 变量。
const { app,contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('eduAPI', {
  getAppInfo: () => ipcRenderer.invoke('app:info'),
  getUserInfo: () => ipcRenderer.invoke('user:info'),
  ipcMessage:(channel,data) =>  ipcRenderer.sendToHost(channel,data),
  winAllMessage:(param) =>  ipcRenderer.send("winAllMessage",param),
  onPageMessage: (callback) => ipcRenderer.on('pageMessage', callback)
})